package com.example.bit.spring_project.mapper;

import com.example.bit.spring_project.Massage.Massage;
import com.example.bit.spring_project.model.MassageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MassageMapper {

    @Select("select * from message_info where delete_flag= 0")
    public List<MassageInfo> selectAll();

    /**
     *直接选中参数列表中的对象的属性,其他属性有默认值或者自增
     */
    @Insert("insert into message_info (`from`, `to`, `message`) values(#{from}, #{to}, #{message})")
    public Integer addMassage(MassageInfo massageInfo);

}
